# Contributor: Leon Marz <lmarz@cs.uni-frankfurt.de>
# Maintainer: Leon Marz <lmarz@cs.uni-frankfurt.de>
pkgname=cglm
pkgver=0.7.7
pkgrel=0
pkgdesc="Highly Optimized Graphics Math (glm) for C"
url="https://github.com/recp/cglm"
arch="all"
license="MIT"
makedepends="autoconf automake libtool py3-sphinx py3-sphinx_rtd_theme"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/recp/cglm/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	sh autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
	cd "docs"
	sphinx-build source build
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir/usr/share/doc/cglm"
	cp -a docs/build "$pkgdir/usr/share/doc/cglm"
}

sha512sums="4ce11af20a67d371b7e420e93b8545c2208e23f03d5d2349971b997691479b1510ee7b22da3f3b78ca33fd5867e16bcd49047ba531f5532c3d2f908693ff773b  cglm-0.7.7.tar.gz"
